package com.huluobo.a2203kotlindouyindemo

import android.app.Application
import android.util.Log
import com.huluobo.base.db.AppDBUtils
import com.hyphenate.chat.EMClient
import com.hyphenate.chat.EMOptions
import com.hyphenate.easeui.EaseIM
import com.tencent.live2.V2TXLivePremier
import com.tencent.live2.V2TXLivePremier.V2TXLivePremierObserver
import com.umeng.commonsdk.UMConfigure
import com.umeng.commonsdk.stateless.UMSLEnvelopeBuild.mContext
import com.umeng.socialize.PlatformConfig


/**
 *  Created by LC on 2024/7/4.
 */
class App : Application() {
    override fun onCreate() {
        super.onCreate()
        AppDBUtils.init(this)
        //友盟初始化
        UMConfigure.init(this, "66878d29cac2a664de60bdf9", "umeng", UMConfigure.DEVICE_TYPE_PHONE, "")
        PlatformConfig.setQQZone("101830139", "5d63ae8858f1caab67715ccd6c18d7a5")

        val licenceURL = "https://license.vod2.myqcloud.com/license/v2/1327074352_1/v_cube.license" // 获取到的 licence url

        val licenceKey = "4f3843d6d2d0ac07945ed3ac37caa4e2" // 获取到的 licence key

        V2TXLivePremier.setLicence(this, licenceURL, licenceKey)
        V2TXLivePremier.setObserver(object : V2TXLivePremierObserver() {
            override fun onLicenceLoaded(result: Int, reason: String) {
                Log.i("TagA", "onLicenceLoaded: result:$result, reason:$reason")
            }
        })

        //moroks#2203kotlinshoppingdemo

        val options = EMOptions()
        options.appKey = "moroks#2203kotlinshoppingdemo"

        if (EaseIM.getInstance().init(this, options)) {
            EMClient.getInstance().setDebugMode(true)
        }
    }
}